attribute vec4 vPos;			//Vertex Position
attribute vec3 vNor;			//Vertex Normal

uniform mat4 modelView;			//ModelView Matrix
uniform mat4 perspective;		//Perspective Matrix
uniform mat3 normalMatrix;		//Normal Matrix, ie Inv-Transpose of ModelView Matrix


varying vec3 eyeSpaceNormal;
varying vec3 lightDir;

void main(void)
{    
	vec4 lightPos = vec4(0.0,0.0,1.0,1.0);	//LightPosition in eyespace(transformed to eyespace on CPU)
	//objectNormal = vNor;
	eyeSpaceNormal = normalMatrix * vNor;	//Transform normals by modelview matrix(normalmatrix) 
	vec4 rawPos = modelView * vPos;			//vertex eyespace position
	lightDir = vec3(lightPos - rawPos);
	
	gl_Position = perspective * rawPos;		//perform perspective divide

	
}

